package com.topcoder.srm512;

public class MarbleDecoration {
	public int maxLength(int R, int G, int B) {
		int a, b;
		if (R > G) {
			a = R;
			b = Math.max(G, B);
		}
		else {
			a = G;
			b = Math.max(R, B);
		}
		
		return a==b? 2*a : 2*Math.min(a, b) + 1;
	}
}
